<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html >
<style>
.inline-block{

display:inline-block;
}
.data_label{
width:60px;text-align:right;
}
</style>
<!-- 管理员修改密码模块 -->
<div class="Box span6 inline-block" style="margin-top: 15px; margin-left: 0px; width:400px; height:400px;vertical-align: top;">
	<div class="Box-head Border" style="padding-left: 25px;">
		<label class="Labelstyle">管理员修改密码</label>
	</div>
	<div class="Box-content center" style=" height:300px;">
		<div class="user_changePsaaword" style="width:350px;padding-top:20px;">
			<div style="margin-bottom: 20px;">
				<label  class="inline-block data_label">旧密码</label>
				<input style="margin-left: 20px;" type="password"  id="oldPassword" placeholder="原密码"></div>
			<div style="margin-bottom: 20px;">
				<label  class="inline-block data_label">新密码</label>
				<input style="margin-left: 20px;" type="password" id="newPassword" placeholder="新密码"></div>
			<div style="margin-bottom: 20px;">
				<label  class="inline-block data_label">新密码</label>
				<input style="margin-left: 20px;" type="password"  id="newpassword2 "placeholder="新密码">
			</div>
		</div>
		<div>
		<input type="button" class="btn btn-info" id="changePassword" value="修改密码">
		</div>
	</div>
</div>
<script type="text/javascript">
$("#changePassword").click(function(){
	 $.ajax({
	async : false,
	cache : false,
	type : 'post',
	url : '/Examination/changePassword',// 请求的action路径
	data : {
		newPassword:$("#newPassword").val(),
	    oldPassword:$("#oldPassword").val()
	
	},
	error : function() {// 请求失败处理函数
		alert("导出失败");

	},
	success : function(data) {// 请求成功处理函数
		
   if(data==0){
	   alert("修改密码成功");
	   $("input[type='password']").val("");
	   
   }
   else{
	   alert("修改密码失败");
   }
	}
  }); 
})
</script>
<!-- 管理员信息模块 -->
<div class="Box span6 inline-block " style="margin-top: 15px; width:400px;vertical-align: top;float:right;">
	<div class="Box-head Border" style="padding-left: 25px;">
		<label class="Labelstyle">管理员信息查看</label>
	</div>
	<div class="Box-content center"  style="height:300px;">
		<div class="user_information center" style="width:350px; padding-top:20px;">
			<div style="margin-bottom: 20px;">
				<label class="inline-block data_label">编号</label>
				<input style="margin-left: 20px;" id="unumber" type="text" id="admin_number" disabled="true" placeholder="编号" value=${user.unumber}>
			</div>
			<div style="margin-bottom: 20px;">
				<label  class="inline-block data_label">姓名</label>
				<input style="margin-left: 20px;" id="uname"type="text" placeholder="姓名" value=${user.uname}></div>
			<div style="margin-bottom: 20px;">
				<label  class="inline-block data_label">性别</label>
				<input style="margin-left: 20px;" id="ugender"type="text" placeholder="性别 " value=${user.ugender}></div>
			<!-- <div style="margin-bottom: 20px;">
				<label  class="inline-block data_label">用户等级</label>
				<input style="margin-left: 20px;" type="text" placeholder="用户等级" ></div> -->
		</div>
		<div> <input type="button" class="btn btn-info" id="changeUserInfo" value="修改用户信息"></div>
	</div>
</div>
<script type="text/javascript">
//修改用户信息
$("#changeUserInfo").click(function(){
	 $.ajax({
			async : false,
			cache : false,
			type : 'post',
			url : '/Examination/changeUserInfo',// 请求的action路径
			data : {
				uname:$("#uname").val(),
				ugender:$("#ugender").val()
			
			},
			error : function() {// 请求失败处理函数
				alert("Ajax失败");

			},
			success : function(data) {// 请求成功处理函数
				
		   if(data==1){
			   alert("修改用户信息成功");
			   
		   }
		   else{
			   alert("修改用户信息失败");
		   }
			}
		  }); 
})
</script>